#include <vector>
#include <iostream>

using namespace std;

int removeDuplicates(vector<int>& nums)
{
	int index = 0;
	for (size_t i = 1; i < nums.size(); i++)
	{
		if (nums[index] != nums[i])
		{
			index++;
			nums[index] = nums[i];
		}
	}
	return index + 1;
}

int main()
{
	vector<int> num = { 0,0,1,1,1,2,2,3,3,4 };
	int count = removeDuplicates(num);
	for (size_t i = 0; i < count; i++)
	{
		std::cout << num[i] << ',';
	}
	std::cout << "size" << count;
	return 0;
}
